package olga.gorbatiuk.perdep.dao;

import olga.gorbatiuk.perdep.dao.concretedao.CustomerDAO;
import olga.gorbatiuk.perdep.dao.concretedao.DepartmentDAO;
import olga.gorbatiuk.perdep.dao.concretedao.EmployeeDAO;
import olga.gorbatiuk.perdep.dao.concretedao.PositionDAO;
import olga.gorbatiuk.perdep.dao.concretedao.ProjectDAO;
import olga.gorbatiuk.perdep.dao.daofactory.impl.CollectionDAOFactory;
import olga.gorbatiuk.perdep.dao.daofactory.impl.MySqlDAOFactory;
import olga.gorbatiuk.perdep.dao.daofactory.impl.XmlDAOFactory;
import olga.gorbatiuk.perdep.dao.daofactory.impl.FileDAOFactory;
import olga.gorbatiuk.perdep.dao.daofactory.impl.OracleDAOFactory;

/**
 *
 * @author Olga Gorbatiuk
 */
public abstract class DAOFactory {

    public abstract CustomerDAO getCustomerDAO();

    public abstract ProjectDAO getProjectDAO();

    public abstract EmployeeDAO getEmployeeDAO();

    public abstract PositionDAO getPositionDAO();

    public abstract DepartmentDAO getDepartmentDAO();

    public static DAOFactory getDAOFactory(DAOTypes whichFactory) {
        switch (whichFactory) {
            case MYSQL:
                return new MySqlDAOFactory();
            case ORACLE:
                return new OracleDAOFactory();
            case XML:
                return new XmlDAOFactory();
            case FILE:
                return new FileDAOFactory();
            case COLLECTION:
                return new CollectionDAOFactory();
            default:
                return null;
        }
    }

}
